<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>井下数据链路监控系统</title>
    
    <script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
    <script src="{{ url_for('static', filename='js/mqtt_send.js') }}"></script>
</head>
<body>
    <div>
        测试mqtt发送Hello World
        <button id="send_hello_world">发送</button>

        <script>
            document.getElementById("send_hello_world").addEventListener("click", function() {

                var host = window.location.hostname;
                var port = 9001;
                var topic = "test/topic";
                var message = "Hello World";

                console.log("host: " + host)
                console.log("port: " + port)
                console.log("topic: " + topic)
                console.log("message: " + message)
                send_mqtt_message(host, port, topic, message)

                console.log("Hello World")
            })
        </script>
    </div>

    
    
</body>
</html>
